package com.lizhangjun.nim.push;

import com.lizhangjun.nim.constant.ImConstant;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.stereotype.Component;

/**
 * redis 消息推送
 */
@Component
public class RedisPublish extends AbstractPublish {

    @Autowired
    private StringRedisTemplate redisTemplate;

    @Override
    public void push(String data) {
        redisTemplate.convertAndSend(ImConstant.TOPIC_IM, data);
    }
}
